package com.example.fitnessapp.controller;



import com.example.fitnessapp.util.ApiResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api/course")
@RequiredArgsConstructor

public class CourseController {
    @GetMapping("/recommend")
    public ApiResponse<List<Map<String, Object>>> recommend(@RequestParam String userId) {
        List<Map<String, Object>> courses = new ArrayList<>();
        Map<String, Object> c = new HashMap<>();
        c.put("courseId", "c001");
        c.put("title", "HIIT燃脂");
        c.put("desc", "高强度间歇训练");
        c.put("cover", "http://xxx.com/cover.jpg");
        c.put("duration", 30);
        courses.add(c);
        return ApiResponse.ok("success", courses);
    }

    @PostMapping("/favorite")
    public ApiResponse<Void> favorite(@RequestBody Map<String, String> req) {
        // TODO: 收藏课程
        return ApiResponse.ok("收藏成功");
    }
}
